package br.com.bikes4bikers.controller.admin;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import br.com.bikes4bikers.controller.commons.LoginController;

@Controller
public class AdminLoginController extends LoginController{
	
	@RequestMapping("/admin/login")
	public ModelAndView login() {
		return new ModelAndView("admin/login");
	}
	
	@RequestMapping("/admin/inicio")
	public String navegarParaPaginaInicialAdministrivo(){
		return "admin/inicio";
	}
	
	@RequestMapping("/admin/funcionario/avatar")
	@ResponseBody
	public byte[] getAvatar(){
		return getUsuarioLogado().getAvatar();
	}
	
	@RequestMapping("/admin/funcionario/logout")
	public void logout(){
		anulaUsuarioLogado();
	}

}
